<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>
<!--{hook portal_start.htm}-->
<div class="row">
    <div class="col-lg-4">
        <div class="card mb-3" style="min-height: 402px;">
            <?php if (!empty($slide)) { ?>
            <div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-ride="carousel">

                <ol class="carousel-indicators">
                    <?php $n = count($slide);for ($i = 0; $i < $n; ++$i) { ?>
                    <li data-target="#carouselExampleIndicators" data-slide-to="<?php echo $i; ?>" <?php if(0 == $i) {echo 'class="active"';} ?>></li>
                    <?php } ?>
                </ol>

                <div class="carousel-inner">
                    <?php $i =0;foreach($slide as &$_thread) {++$i;?>
                    <div class="carousel-item <?php if (1 == $i) {echo 'active';} ?>">
                        <a href="<?php echo $_thread['url'];?>">
                            <img class="d-block w-100" src="<?php echo $_thread['icon_fmt']; ?>" alt='<?php echo $_thread['subject'];?>'>
                            <!--<div class="carousel-caption d-none d-md-block">
                                <h2 class="h6">
                                    <?php echo $_thread['subject'];?>
                                </h2>
                            </div>-->
                        </a>
                    </div>
                    <?php } ?>
                </div>
            </div>
            <?php } ?>

            <!--所有属性-->
            <div class="row mt-2">
                <div class="col-md-12">
                    <ul class="list-unstyled threadlist ul_round">
                        <?php if (!empty($arrlist['flag'])) {foreach($arrlist['flag'] as $_thread) { ?>
                        <li class="tap ml-2" data-href="<?php echo $_thread['url'];?>">
                            <h2 class="h6 ellipsis">
                                <a href="<?php echo $_thread['url'];?>" title='<?php echo $_thread['subject'];?>' aria-label='<?php echo $_thread['subject'];?>'>
                                    <?php echo $_thread['subject'];?>
                                </a>
                            </h2>
                        </li>
                        <?php }} ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--置顶-->
    <div class="col-lg-5">
        <div class="card mb-3" style="min-height: 402px;">
            <div class="py-1 px-4">
                <ul class="list-unstyled threadlist">
                    <?php if (!empty($arrlist['sticky'])) {foreach ($arrlist['sticky'] as $_thread) {if ($_thread['i'] <= 4 /* 4为显示数量，根据自己需要调整数字 */) { ?>
                    <li class="thread">
                        <h2 class="h6 font-weight-bold text-break nowrap">
                            <a class="d-block ellipsis" href="<?php echo $_thread['url'];?>" title='<?php echo $_thread['subject'];?>' aria-label='<?php echo $_thread['subject'];?>'>
                                <?php echo $_thread['subject'];?>
                            </a>
                        </h2>
                        <a href="<?php echo $_thread['url'];?>" title='<?php echo $_thread['subject'];?>' aria-label='<?php echo $_thread['subject'];?>'>
                            <p class="m-t-sm mb-1 text-grey text-break">
                                <?php echo $_thread['brief']?$_thread['brief']:lang('no_brief');?>
                            </p>
                        </a>
                    </li>
                    <?php }}} ?>
                </ul>
            </div>
        </div>
    </div>

    <div class="col-lg-3 d-none d-lg-block">
        <div class="card mb-3" style="min-height: 402px;">
            <!--<div class="card-header">推荐</div>-->
            <div class="row nowrap mx-1 mt-3">
                <?php if($first_flag){foreach($first_flag as $_thread) { ?>
                <div class="col-lg-12">
                    <a class="d-block ellipsis" href="<?php echo $_thread['url'];?>" title='<?php echo $_thread['subject'];?>' aria-label='<?php echo $_thread['subject'];?>'>
                        <?php echo $_thread['subject'];?>
                    </a>
                </div>
                <?php }} ?>
            </div>
        </div>
    </div>
</div>
<!--{hook portal_before.htm}-->
<div class="row">
    <?php if (!empty($arrlist['list'])) { foreach ($arrlist['list'] as $_forum) { ?>
    <div class="col-md-6">
        <div class="card mb-3">
            <div class="card-header">
                <div class="row justify-content-between m-0">
                    <div>
                        <strong>
                            <a href="<?php echo $_forum['url'];?>" title='<?php echo $_forum['name'];?>'>
                                <?php echo $_forum['name']; ?>
                            </a>
                        </strong>
                    </div>
                    <div>
                        <a href="<?php echo $_forum['url'];?>">
                            <i class="icon-angle-double-right"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4">
                    <ul class="row list-unstyled threadlist nowrap pl-2 mb-0">
                        <?php if (!empty($_forum['news'])) {$i=0; foreach ($_forum['news'] as $_thread) {if ($_thread['icon_fmt'] && ++$i <= 2) { ?>
                        <li class="col-6 col-md-12 mt-3">
                            <a href="<?php echo $_thread['url'];?>">
                                <img class="d-block w-100" src="<?php echo $_thread['icon_fmt']; ?>" alt='<?php echo $_thread['subject'];?>'>

                                <div class="ellipsis">
                                    <?php echo $_thread['subject'];?>
                                </div>
                            </a>
                        </li>
                        <?php }}}else{ ?>
                        <li class="col-md-12">
                            <img class="main-pic" src="<?php echo view_path();?>img/nopic.png" width="170" height="128">
                            <p class="p-2 m-0">
                                <?php echo lang('none');?>
                            </p>
                        </li>
                        <?php } ?>
                    </ul>
                </div>

                <div class="col-md-8">
                    <ul class="list-unstyled threadlist nowrap pt-3">
                        <!--最新内容-->
                        <?php if (!empty($_forum['news'])) { foreach ($_forum['news'] as $_thread) { ?>
                        <li class="col-lg-12 tap ellipsis" data-href="<?php echo $_thread['url'];?>">
                            <a href="<?php echo $_thread['url'];?>" title='<?php echo $_thread['subject'];?>'>
                                <h2 class="h6 ellipsis">
                                    <?php echo $_thread['subject'];?>
                                </h2>
                            </a>
                        </li>
                        <?php }} ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <?php }} ?>
</div>

<?php if(!empty($linklist)){ ?>
<div class="card mb-3">
    <div class="card-header"><?php echo lang('friends_link');?></div>
    <div class="nav bg-white">
        <?php foreach($linklist as &$_link) { ?>
            <a href="<?php echo $_link['url'];?>" class="nav-link"  target="_blank" aria-label='<?php echo $_link['name'];?>'>
                <?php echo $_link['name'];?>
            </a>
        <?php } ?>
    </div>
</div>
<?php } ?>

<!--{hook portal_end.htm}-->
<?php include _include(APP_PATH . 'view/htm/footer.inc.htm');?>

<script>
    $('#nav li[data-active="fid-<?php echo $fid;?>"]').addClass('active');
</script>
<!--{hook portal_js.htm}-->